<template>
	<view class="content">
		<image :class="className" src="/static/logo.png"></image>
		<view class="text-area">
			<text class="title" @:click="open">{{title}}</text>
		</view>
		<view>
			<view>{{ number + 1 }}</view>
			<view>{{ok?"YES":"NO"}}</view>
			<view>{{message.split('').reverse().join('')}}</view>
		</view>
		<view v-if="!raining">今天天气真好</view>
		<view v-if="raining">下雨天，天气很糟糕</view>
		<view v-if="state=='vue'">State的值是Vue</view>
		<view v-if="state=='vue'">State的值是Vue</view>
		<view>State is {{state?'vue':'APP'}}</view>
		<view>
			<view v-if="state=='vue'"uni-app></view>
			<view v-else-if="state=='html'">HTML</view>
			<view v-else>APP</view>
		</view>
		<view class="content">
			<view v-for="item in arr" style="color:#00ffff;">
				{{item}}
			</view>
			<view v-for="(item,index) in 4" style="color:#00ff00;">
				<view :class="'list-' + index%2">{{index%2}}</view>
			</view>
			<view v-for="(item,index) in 4" style="color:#ffaaff;">
				<view :class="'list-' + index%2">{{index%2}}</view>
			</view>
			<view v-for="(value,name,index) in object" style="color:#5500ff;">
				{{index}}.{{name}}:{{value}}
			</view>
			<view v-for="(value,name,index) in object" style="color:#5500ff;">
				{{index}}---{{name}}---{{value}}
			</view>
			<view v-for="item in arr" :key="item.id">
				<view style="color: #00ffff;">{{item.id}}:{{item.name}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title:'Hello UniAPP',
				className:'smalllogo',
				number:3,
				ok:1==2,
				message:'Hello Vue!',
				raining:false,
				state:'vue',
				arr:[
					{id:1,name:"uni-app"},
					{id:2,name:"HTML"}
				],
				object:{
					title:"how to lists in Vue?",
					author:"Jane Doe",
					publishedAt:'2020-04-10'
				}
			}
		},
		methods: {
			open(){
				this.title="opening a new Page";
				this.className = "logo"
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}
	
	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}
	.smalllogo{
		height:100rpx;
		width:100rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}
</style>
